package com.mcay.easyexcel.exception;

import com.mcay.easyexcel.enums.ExcelEnum;

/**
 * easyexcel 异常类
 * Created by  longHe
 * 2021/8/19 16:12
 */
public class ExcelException extends RuntimeException{

    private Integer code;

    public ExcelException(Integer code) {
        this.code = code;
    }

    public ExcelException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public ExcelException(ExcelEnum excelEnum) {
        super(excelEnum.getMessage());
        this.code = excelEnum.getCode();
    }

    public ExcelException(String message, Throwable cause, Integer code) {
        super(message, cause);
        this.code = code;
    }

    public ExcelException(Throwable cause, Integer code) {
        super(cause);
        this.code = code;
    }

    public ExcelException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Integer code) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
    }
}